package com.aaa.dao;

import com.aaa.entity.project;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;


public interface L_dataqueryDao {

    @Select("select * from testproject ")
    List<project> getYiji(Map m);

    @Select("select * from testcontent where pid = #{pid}")
    List<Map> selectListTwo(Integer id);

    @Select("select * from year")
    List<Map> selectYears();

    @Select("select * from testcontent a,year b where content=#{title} and a.yearid=b.id  ")
    Map getSBXM(String title);

    @Insert("insert into test_data(testid,danwei,filepath,filename,qingdan,qingqiu,level,state,title) values(#{id},#{name},#{filepath},#{filename},#{qingdan},#{qingqiu},#{grading},0,#{title})")
    void insertdata(Map map);

    @Select("select * from test_data where title=#{title}  ")
    List<Map> CX(Map map);

    @Select("select count(id) from test_data " +
            " where 1=1 " +
            "  and title like concat('%',#{title},'%')")
    Integer getCount(Map map);

    @Select("select * from test_data where id=#{id}")
    Map cha(Integer id);


    @Select("select  * from test_data where title=#{title} order by state DESC  limit #{start},#{pageSize} ")
    List<Map> getSH(Map map);

    @Select("select count(id) from test_data " +
            " where 1=1 " +
            "  and title like concat('%',#{title},'%')")
    Integer getSHcount(Map map);

    @Update("update test_data set  user=#{user},score=#{score},time=#{time},state=1 where id=#{id}  ")
    int SHgo(Map map);

    @Select("select * from test_data where qingdan=#{qingdan} and danwei=#{danwei} ")
    List<Map> rep(Map map);

    @Update("update test_data set state=2 where id=#{id}")
    void SHreturn(Map map);

    @Select(" select kscore from regist a where a.`name`=#{name}")
    List<Map> getkscore(Map map);

    @Update(" update regist a set a.kscore=#{score}  where  a.`name`=#{name} ")
    void upkscore(Map map);

    @Update(" update regist a set a.kscore=a.kscore+#{score}  where  name=#{name}  ")
    void setkscore(Map map);
}
